package test04.sync.test07.sisuo.a;

/**
 * @Author zqx
 * @Date 2024-03-21
 */
public class OneThread extends Thread{
    /**
     * 锁对象
     */
    public static final Object oneLock = new Object();
    @Override
    public void run() {
        // t1 - 时间片比较多
        synchronized (oneLock) {
            System.out.println("OneThread-获得了oneLock这把锁，做一些相关的处理...");
            // t1 --- oneLock - twoLock - 但 t1 无法释放 oneLock
            synchronized (TwoThread.twoLock) {
                System.out.println("OneThread-获得了twoLock这把锁，做一些相关的处理...");
            }
        }
    }
}
